<template>
  <div class="common-body-wrapper">
    <!-- <search-header single-width="130" :searchList="[]" @changeHeight="toRetTable" @confirmSearch="toSearch"></search-header> -->
    <div class="common-table-tree-wrapper">
      <!-- <table-tree :isNeedTree="isNeedTree" :paramName="paramName" @toggleTreeBox="toggleTreeBox" @setSelectedNode="setSelectedNode" @searchFn="getList">
      </table-tree>-->
      <div class="common-table-wrapper">
        <multi-fun-table
          :sortColumn="notFormatColumn"
          :orderType="sortType"
          :fixed-cols="fixedCols"
          :is-reset-table="isResetTable"
          :theads-info="theadsInfo"
          :tbodys-info="tbodysInfo"
          @handleMultiCheck="handleMultiCheck"
          @handleSortColumn="handleSortColumn"
          @searchFn="getList"
          @getNextPage="getNextPage"
        >
          <div class="operate-btn-group" slot="operateBtnGroup">
            <a
              class="ake_btn ake_btn_text"
              v-if="isPermmited('PLATFORM:PARKINGBASEDATA:EXPORT')"
              @click.prevent="exportData()"
            >导出</a>
          </div>
          <template slot="tdCell" slot-scope="props">
            <el-table-column
              :fixed="props.fixed"
              :label="props.label"
              :min-width="props.minWidth"
              :width="props.width"
              :prop="props.prop"
              :sortable="props.sortable"
            >
              <template slot-scope="scope">
                <span v-if="'reno' == props.prop">{{scope.$index+1}}</span>
                <span v-else-if="'picpath' == props.prop">
                  <a
                    class="imgLink"
                    @click="showBigImgModal('bigPicModal', scope.row['picpath'])"
                  >查看</a>
                </span>
                <span v-else-if="'chargeRuleUrl' == props.prop">
                  <a
                    class="imgLink"
                    @click="showBigImgModal('bigPicModal', scope.row['chargeRuleUrl'])"
                  >查看</a>
                </span>
                <span v-else>{{ scope.row[props.prop] }}</span>
              </template>
            </el-table-column>
          </template>
          <template slot="operateCell" slot-scope="props">
            <el-table-column :fixed="props.fixed" :label="props.label" min-width="130">
              <template slot-scope="scope">
                <!-- <a target="_blank" :href="scope.row['park_vems_url']" v-if="isPermmited('PLATFORM:PARKINGBASEDATA:LINK') && scope.row['park_vems_url']"> -->
                <el-button
                  @click="openVems(scope.row['parkCode'])"
                  size="small"
                  type="primary"
                  class="ake_btn_text"
                  v-if="isPermmited('PLATFORM:PARKINGBASEDATA:LINK') && scope.row['parkSysType']==0"
                >连接停车场</el-button>
                <!-- </a> -->
              </template>
            </el-table-column>
          </template>
        </multi-fun-table>

        <table-pagination :size="total" :cur-page="pageNumber" @backData="getPagination"></table-pagination>
      </div>
    </div>
    <big-pic-modal ref="bigPicModal">
      <img
        slot="bigImgSlot"
        :src="bigImgPath | setImgPath"
        alt
        @error="imgError('../../', 'car', $event)"
      />
    </big-pic-modal>
  </div>
</template>

<script>
import common from "@mixins/common.js";
import stardardList from "@mixins/tables/stardardList.js";

//modal
import invokeModal from "@mixins/modal/invokeModal.js";
import BigPicModal from "@components/widgets/BigPicModal.vue";

// image
import images from "@mixins/image.js";

// 引进vue的js
import park_info from "./js/park_info.js";
export default {
  mixins: [common, stardardList, invokeModal, images, park_info],
  components: {
    BigPicModal
  },
  data() {
    return {
      fixedCols: 3,
      total: 0,
      paramName: "id",

            //prop-返回数据的字段名称   proisNotInter:true,pNameisNotInter:true,，name-查询字段传参名称    text-显示名称  //initHidden  初始化不显示
            searchList: [
                // { type: 'text', isShow: false, name: 'plate', text: '车牌号码', value: '' },
                // { type: 'text', isShow: false, name: 'approchChannel', text: '进场通道', value: '' },
                // { type: 'text', isShow: false, name: 'leaveChannel', text: '出场通道', value: '' },
                // { type: 'text', isShow: false, name: 'approchVipType', text: '进场VIP类型', value: '' },
                // { type: 'text', isShow: false, name: 'leaveVipTyp', text: '出场VIP类型', value: '' },
                // { type: 'datePicker', isShow: false, name: 'query_time', text: '进场时间', propName: 'approchTimeFrom,approchTimeTo', value: '', style: { width: '360px' } },
                // { type: 'datePicker', isShow: false, name: 'query_time', text: '出场时间', propName: 'leaveTimeFrom,leaveTimeTo', value: '', style: { width: '360px' } },
            ],
            theadsInfo: [
                { index: 0, isShow: false, prop: 'reno', text: '序号', width: 64 },
                { index: 1, isShow: false, prop: 'name', text: '停车场', sortable: true, minWidth: 180 },
                { index: 1, isShow: false, prop: 'parkCode', text: '车场编号', sortable: true, minWidth: 120 },
                { index: 2, isShow: false, prop: 'picpath', text: '车场图片', sortable: true, minWidth: 110 },
                { index: 3, isShow: false, prop: 'slotsnumber', text: '总车位数', sortable: true, minWidth: 110 },
                { index: 4, isShow: false, prop: 'fixedCarports', text: '固定车位数', sortable: true, minWidth: 180 },
                { index: 5, isShow: false, prop: 'tempCarports', text: '临时车位数', sortable: true, minWidth: 180 },
                { index: 6, isShow: false, prop: 'remainpostionnum', text: '可预订车位总数', sortable: true, minWidth: 180 },
                { index: 7, isShow: false, prop: 'parkingType', text: '车场类型', sortable: true, minWidth: 180 },
                { index: 8, isShow: false, prop: 'isfree', text: '是否收费', sortable: true, minWidth: 180 },
                { index: 9, isShow: false, prop: 'freeTime', text: '免费时长(分钟)', sortable: true, minWidth: 150 },
                { index: 10, isShow: false, prop: 'chargeRuleUrl', text: '收费图片', sortable: true, minWidth: 110 },
                { index: 11, isShow: false, prop: 'timeoutLength', text: '缴费后离场时间(分钟)', sortable: true, minWidth: 180 },
                { index: 12, isShow: false, prop: 'address', text: '地址', sortable: true, minWidth: 320 },
            ],
            tbodysInfo: []
        }
    },
    methods: {
        confirmSearch(params) {
            this.getList();
        }
      ],
      tbodysInfo: []
    };
  },
  methods: {
    confirmSearch(params) {
      this.getList();
    }
  }
};
</script>

<style lang="less" scoped>
</style>